home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacOS 8 Resources / Developer Tools / Mac OS 8 Interfaces & Libraries / Interfaces / CIncludes / AIFF.h < prev    next >
C/C++ Source or Header  |  1996-05-01  |  5KB  |  242 lines

  1. /*
  2.      File:        AIFF.h
  3.  
  4.      Contains:    Definition of AIFF file format components.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Release:    Universal Interfaces 3.0d3 on Copland DR1
  8.  
  9.      Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  10.  
  11.      Bugs?:        If you find a problem with this file, send the file and version
  12.                  information (from above) and the problem description to:
  13.  
  14.                      Internet:    apple.bugs@applelink.apple.com
  15.                      AppleLink:    APPLE.BUGS
  16.  
  17. */
  18. #ifndef __AIFF__
  19. #define __AIFF__
  20.  
  21. #ifndef __TYPES__
  22. #include <Types.h>
  23. #endif
  24.  
  25. #ifdef __cplusplus
  26. extern "C" {
  27. #endif
  28.  
  29. #if PRAGMA_IMPORT_SUPPORTED
  30. #pragma import on
  31. #endif
  32.  
  33. #if PRAGMA_ALIGN_SUPPORTED
  34. #pragma options align=mac68k
  35. #endif
  36.  
  37.  
  38. enum {
  39.     AIFFID                        = 'AIFF',
  40.     AIFCID                        = 'AIFC',
  41.     FormatVersionID                = 'FVER',
  42.     CommonID                    = 'COMM',
  43.     FORMID                        = 'FORM',
  44.     SoundDataID                    = 'SSND',
  45.     MarkerID                    = 'MARK',
  46.     InstrumentID                = 'INST',
  47.     MIDIDataID                    = 'MIDI',
  48.     AudioRecordingID            = 'AESD',
  49.     ApplicationSpecificID        = 'APPL',
  50.     CommentID                    = 'COMT',
  51.     NameID                        = 'NAME',
  52.     AuthorID                    = 'AUTH',
  53.     CopyrightID                    = '(c) ',
  54.     AnnotationID                = 'ANNO'
  55. };
  56.  
  57.  
  58. enum {
  59.     NoLooping                    = 0,
  60.     ForwardLooping                = 1,
  61.     ForwardBackwardLooping        = 2,                            /* AIFF-C Versions */
  62.     AIFCVersion1                = 0xA2805140
  63. };
  64.  
  65. /* Compression Names */
  66. #define NoneName "\pnot compressed"
  67. #define ACE2to1Name "\pACE 2-to-1"
  68. #define ACE8to3Name "\pACE 8-to-3"
  69. #define MACE3to1Name "\pMACE 3-to-1"
  70. #define MACE6to1Name "\pMACE 6-to-1"
  71.  
  72.  
  73. enum {
  74.                                                                 /* Compression Types */
  75.     NoneType                    = 'NONE',
  76.     ACE2Type                    = 'ACE2',
  77.     ACE8Type                    = 'ACE8',
  78.     MACE3Type                    = 'MAC3',
  79.     MACE6Type                    = 'MAC6'
  80. };
  81.  
  82. typedef unsigned long ID;
  83. typedef short MarkerIdType;
  84. struct ChunkHeader {
  85.     ID                                 ckID;
  86.     long                             ckSize;
  87. };
  88. typedef struct ChunkHeader ChunkHeader;
  89.  
  90. struct ContainerChunk {
  91.     ID                                 ckID;
  92.     long                             ckSize;
  93.     ID                                 formType;
  94. };
  95. typedef struct ContainerChunk ContainerChunk;
  96.  
  97. struct FormatVersionChunk {
  98.     ID                                 ckID;
  99.     long                             ckSize;
  100.     unsigned long                     timestamp;
  101. };
  102. typedef struct FormatVersionChunk FormatVersionChunk;
  103.  
  104. typedef FormatVersionChunk *FormatVersionChunkPtr;
  105. struct CommonChunk {
  106.     ID                                 ckID;
  107.     long                             ckSize;
  108.     short                             numChannels;
  109.     unsigned long                     numSampleFrames;
  110.     short                             sampleSize;
  111.     extended80                         sampleRate;
  112. };
  113. typedef struct CommonChunk CommonChunk;
  114.  
  115. typedef CommonChunk *CommonChunkPtr;
  116. struct ExtCommonChunk {
  117.     ID                                 ckID;
  118.     long                             ckSize;
  119.     short                             numChannels;
  120.     unsigned long                     numSampleFrames;
  121.     short                             sampleSize;
  122.     extended80                         sampleRate;
  123.     ID                                 compressionType;
  124.     char                             compressionName[1];            /* variable length array, Pascal string */
  125. };
  126. typedef struct ExtCommonChunk ExtCommonChunk;
  127.  
  128. typedef ExtCommonChunk *ExtCommonChunkPtr;
  129. struct SoundDataChunk {
  130.     ID                                 ckID;
  131.     long                             ckSize;
  132.     unsigned long                     offset;
  133.     unsigned long                     blockSize;
  134. };
  135. typedef struct SoundDataChunk SoundDataChunk;
  136.  
  137. typedef SoundDataChunk *SoundDataChunkPtr;
  138. struct Marker {
  139.     MarkerIdType                     id;
  140.     unsigned long                     position;
  141.     Str255                             markerName;
  142. };
  143. typedef struct Marker Marker;
  144.  
  145. struct MarkerChunk {
  146.     ID                                 ckID;
  147.     long                             ckSize;
  148.     unsigned short                     numMarkers;
  149.     Marker                             Markers[1];                    /* variable length array */
  150. };
  151. typedef struct MarkerChunk MarkerChunk;
  152.  
  153. typedef MarkerChunk *MarkerChunkPtr;
  154. struct AIFFLoop {
  155.     short                             playMode;
  156.     MarkerIdType                     beginLoop;
  157.     MarkerIdType                     endLoop;
  158. };
  159. typedef struct AIFFLoop AIFFLoop;
  160.  
  161. struct InstrumentChunk {
  162.     ID                                 ckID;
  163.     long                             ckSize;
  164.     UInt8                             baseFrequency;
  165.     UInt8                             detune;
  166.     UInt8                             lowFrequency;
  167.     UInt8                             highFrequency;
  168.     UInt8                             lowVelocity;
  169.     UInt8                             highVelocity;
  170.     short                             gain;
  171.     AIFFLoop                         sustainLoop;
  172.     AIFFLoop                         releaseLoop;
  173. };
  174. typedef struct InstrumentChunk InstrumentChunk;
  175.  
  176. typedef InstrumentChunk *InstrumentChunkPtr;
  177. struct MIDIDataChunk {
  178.     ID                                 ckID;
  179.     long                             ckSize;
  180.     UInt8                             MIDIdata[1];                /* variable length array */
  181. };
  182. typedef struct MIDIDataChunk MIDIDataChunk;
  183.  
  184. typedef MIDIDataChunk *MIDIDataChunkPtr;
  185. struct AudioRecordingChunk {
  186.     ID                                 ckID;
  187.     long                             ckSize;
  188.     UInt8                             AESChannelStatus[24];
  189. };
  190. typedef struct AudioRecordingChunk AudioRecordingChunk;
  191.  
  192. typedef AudioRecordingChunk *AudioRecordingChunkPtr;
  193. struct ApplicationSpecificChunk {
  194.     ID                                 ckID;
  195.     long                             ckSize;
  196.     OSType                             applicationSignature;
  197.     UInt8                             data[1];                    /* variable length array */
  198. };
  199. typedef struct ApplicationSpecificChunk ApplicationSpecificChunk;
  200.  
  201. typedef ApplicationSpecificChunk *ApplicationSpecificChunkPtr;
  202. struct Comment {
  203.     unsigned long                     timeStamp;
  204.     MarkerIdType                     marker;
  205.     unsigned short                     count;
  206.     char                             text[1];                    /* variable length array, Pascal string */
  207. };
  208. typedef struct Comment Comment;
  209.  
  210. struct CommentsChunk {
  211.     ID                                 ckID;
  212.     long                             ckSize;
  213.     unsigned short                     numComments;
  214.     Comment                         comments[1];                /* variable length array */
  215. };
  216. typedef struct CommentsChunk CommentsChunk;
  217.  
  218. typedef CommentsChunk *CommentsChunkPtr;
  219. struct TextChunk {
  220.     ID                                 ckID;
  221.     long                             ckSize;
  222.     char                             text[1];                    /* variable length array, Pascal string */
  223. };
  224. typedef struct TextChunk TextChunk;
  225.  
  226. typedef TextChunk *TextChunkPtr;
  227.  
  228. #if PRAGMA_ALIGN_SUPPORTED
  229. #pragma options align=reset
  230. #endif
  231.  
  232. #if PRAGMA_IMPORT_SUPPORTED
  233. #pragma import off
  234. #endif
  235.  
  236. #ifdef __cplusplus
  237. }
  238. #endif
  239.  
  240. #endif /* __AIFF__ */
  241.  
  242.